package text2;

import java.util.ArrayList;
import java.util.Scanner;

public class SchoolSystem implements ISignUp{ //实现初始化 SchoolSystem类
    private static Integer big;
    private static Integer medium;
    private static Integer small;
    static Boolean[] b;
    public SchoolSystem(Integer  big, Integer medium, Integer small){   //三个参数分别对应每种班级的剩余名额 
        this.big = big;
        this.medium = medium;
        this.small = small;
    }
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        String[] c=(scanner.next()).trim().split("[\\s\\p{Punct}]+");
        b=new Boolean[c.length+3];
        IParams params = ISignUp.parse();//SchoolSystem.parse();
        SchoolSystem sc = new SchoolSystem(params.getBig(), params.getMedium(), params.getSmall());
        ArrayList<Integer> plan = params.getPlanSignUp();
        for (int i = 0; i < plan.size(); i++) {
                b[i+1]= sc.addStudent(plan.get(i));
        }
        sc.print();
    }
    public void print(){
        System.out.print("[");
        for(int i = 0; i<b.length;i++){
            if(i==b.length-1){
                System.out.print(b[i] );
            }else {
                System.out.print(b[i] + ",");
            }
        }
        System.out.print("]");
    }
    public boolean addStudent(int stuType) {
        if (stuType==1){
            if((this.big=big-1)>=0){
                return true;
            }else {
                return false;
            }
        }else if (stuType==2){
            if((this.medium=medium-1)>=0){
                return true;
            }else {
                return false;
            }
        }else{
            if((this.small=small-1)>=0){
                return true;
            }else {
                return false;
            }
        }
    }
    public static String[] parse(String input){
        String input1 =input.trim();
        String[] a = input1.split("[\\s\\p{Punct}]+");
        return a;
    }
    }
